import React from 'react';
import {inject, observer} from 'mobx-react';
import './style.css';
import CommButton from '../HOC/CommButton';


// 函数组件的注入状态 和声明一个组件为观察状态的组件；
const Header = inject('userInfo')(observer((props) => {
    // console.log(props);
    const {user,userName,count}=props.userInfo
    return (
        <div className="user" style={{border:'1px solid blue'}}>
            <h1 className="user_list2">name:{user.name}</h1>
            <h1 className="user_list2">role:{user.role}</h1>
            <h1 className="user_list2">@computed:{userName}</h1>
            <h1 className="user_list2">count:{count}</h1>
            <CommButton name="修改"></CommButton>
        </div>
    );
}))

export default Header;
